home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Tele / Pete Johnson / mehit 3.0.b15<source>.cpt / mehit dialogs.p < prev    next >
Text File  |  1991-07-07  |  42KB  |  1,437 lines

  1. unit mehitDialogs;
  2.  
  3. interface
  4.  
  5. uses
  6.     Globals, mehitFile, Help, HelloTabby, Backup, FileAndStuffIt;
  7.  
  8. var
  9.     Changed: boolean;                    {    Did we change a setting?        }
  10.  
  11. procedure ConfigureDialog;
  12.  
  13. procedure GlobalDialog (var AString: STR255);
  14.  
  15. procedure GetHelp (RefNum: integer);
  16.  
  17. implementation
  18.  
  19. {-----------------------------------------------------------------    }
  20.  
  21. function ButtonSelected (whichDialog: DialogPtr; whichItem: integer): boolean;
  22.  
  23.     var
  24.         whichType: integer;
  25.         whichHandle: handle;
  26.         whichRect, displayRect: rect;
  27.         mouseLoc: point;
  28.         DelayTime: longint;
  29.         nowInverted: boolean;
  30.  
  31.     begin
  32.         getDItem(whichDialog, whichItem, whichType, whichHandle, whichRect);
  33.         displayRect := whichRect;
  34.         InsetRect(displayRect, 1, 1);
  35.         InvertRect(displayRect);
  36.         nowInverted := true;
  37.         if StillDown then
  38.             repeat
  39.                 GetMouse(mouseLoc);
  40.                 if PtInRect(mouseLoc, whichRect) then
  41.                     begin
  42.                         if not nowInverted then
  43.                             begin
  44.                                 InvertRect(displayRect);
  45.                                 nowInverted := true
  46.                             end
  47.                     end
  48.                 else
  49.                     begin
  50.                         if nowInverted then
  51.                             begin
  52.                                 InvertRect(displayRect);
  53.                                 nowInverted := false
  54.                             end
  55.                     end
  56.             until not StillDown;
  57.         if nowInverted then
  58.             begin
  59.                 Delay(4, DelayTime);
  60.                 InvertRect(displayRect)
  61.             end;
  62.         ButtonSelected := nowInverted
  63.     end;
  64.  
  65. {-----------------------------------------------------------------    }
  66.  
  67. function GetTheNumber (dialog: DialogPtr; number: integer): integer;
  68.  
  69. {strips non-numeric characters out of string and returns item value}
  70.  
  71.     var
  72.         i: integer;
  73.         aLong: longint;
  74.         aString, itemString: str255;
  75.         iType: integer;
  76.         iHandle: handle;
  77.         iBox: rect;
  78.  
  79.     begin
  80.         GetDItem(dialog, number, iType, iHandle, iBox);
  81.         GetIText(iHandle, itemString);
  82.         aString := '';
  83.         for i := 1 to length(itemString) do
  84.             if itemString[i] in ['0'..'9'] then
  85.                 aString := concat(aString, itemString[i]);
  86.         StringToNum(aString, aLong);
  87.         GetTheNumber := aLong
  88.     end;
  89.  
  90. {-----------------------------------------------------------------    }
  91.  
  92. procedure ToggleItem (theDialog: DialogPtr; DItem: integer);
  93.  
  94.     var
  95.         iType: integer;
  96.         iHandle: handle;
  97.         iBox: rect;
  98.  
  99.     begin
  100.         getDItem(theDialog, DItem, iType, iHandle, iBox);
  101.         if GetCtlValue(ControlHandle(iHandle)) = 0 then
  102.             SetCtlValue(ControlHandle(iHandle), 1)
  103.         else
  104.             SetCtlValue(ControlHandle(iHandle), 0)
  105.     end;
  106.  
  107. {-----------------------------------------------------------------    }
  108.  
  109. procedure GetHelp; {(RefNum: integer);}
  110.  
  111.     var
  112.         where: point;
  113.         theDialog: DialogPtr;
  114.         HelpItem, HelpRef: integer;
  115.  
  116.     begin
  117.         InitCursor;
  118.         HelpRef := OpenResFile('mehit help');
  119.         if HelpRef = -1 then        {    no help file    }
  120.             begin
  121.                 theDialog := GetNewDialog(1004, nil, Pointer(-1));
  122.                 SetPort(theDialog);
  123.                 FrameDItem(theDialog, OK);
  124.                 repeat
  125.                     ModalDialog(nil, HelpItem);
  126.                 until (HelpItem = 1);
  127.                 DisposDialog(theDialog);
  128.             end        {    HelpRef = -1    }
  129.         else
  130.             begin
  131.                 Help(RefNum, RefNum);
  132.                 CloseResFile(HelpRef);
  133.             end;
  134.     end;    {    procedure GetHelp}
  135.  
  136. {-----------------------------------------------------------------    }
  137.  
  138. procedure ConfigureDialog;
  139.  
  140.     var
  141.         ConfigDialog, StuffItDialog: DialogPtr;
  142.         DItem, BuffItem, iType: integer;
  143.         iHandle: Handle;
  144.         iBox, EField1, EField2, EField3, EField4, EField5: rect;
  145.         Finished, Cancel: boolean;
  146.         AString, PathName: STR255;
  147.         Counter: integer;
  148.         where: point;
  149.         BuffDone: boolean;
  150.         tempDefaultPtr: DefaultStuffPtr;
  151.  
  152.     function DoStuffItDialog (var stuffMode: integer): boolean;
  153.  
  154.         var
  155.             stuffitItem, stuffCount: integer;
  156.             stuffHandle: Handle;
  157.             stuffVersString: str255;
  158.             tempLong: longint;
  159.             currentPort: GrafPtr;
  160.  
  161.         begin
  162.             GetPort(currentPort);
  163.             if StuffItExists | FindStuffIt then    {FindStuffIt verifies StuffIt & sets StuffItExists true}
  164.                 begin
  165.                     CloseStuffIt;
  166.                     StuffItDialog := GetNewDialog(1010, nil, Pointer(-1));
  167.                     SetPort(StuffItDialog);
  168.                     FrameDItem(StuffItDialog, Ok);
  169.                     for StuffCount := 2 to 7 do
  170.                         begin
  171.                             getDItem(StuffItDialog, StuffCount, iType, stuffHandle, iBox);
  172.                             SetCtlValue(ControlHandle(stuffHandle), 0);
  173.                         end;
  174.                     getDItem(StuffItDialog, stuffMode + 2, iType, stuffHandle, iBox);
  175.                     SetCtlValue(ControlHandle(stuffHandle), 1);
  176.                     getDItem(StuffItDialog, 9, iType, stuffHandle, iBox);
  177.                     SetIText(stuffHandle, StuffItVersion);
  178.                     stuffVersString := copy(StuffItVersion, 1, pos('.', StuffItVersion));
  179.                     StringToNum(stuffVersString, tempLong);
  180.                     if (tempLong < 2) then
  181.                         begin
  182.                             getDItem(StuffItDialog, ord(StuffNone) + 2, iType, stuffHandle, iBox);
  183.                             HiliteControl(ControlHandle(stuffHandle), 255);
  184.                             getDItem(StuffItDialog, ord(StuffNone) + 2, iType, stuffHandle, iBox);
  185.                             HiliteControl(ControlHandle(stuffHandle), 255);
  186.                         end;
  187.  
  188.                     repeat
  189.                         ModalDialog(nil, StuffItItem);
  190.                         case StuffItItem of
  191.                             2..7: 
  192.                                 for stuffCount := 2 to 7 do
  193.                                     begin
  194.                                         getDItem(StuffItDialog, stuffCount, iType, stuffHandle, iBox);
  195.                                         if stuffCount <> StuffItItem then
  196.                                             SetCtlValue(ControlHandle(stuffHandle), 0)
  197.                                         else
  198.                                             SetCtlValue(ControlHandle(stuffHandle), 1)
  199.                                     end;
  200.                             otherwise
  201.                                 ;
  202.                         end
  203.                     until StuffItItem = OK;
  204.                     for stuffCount := 2 to 7 do
  205.                         begin
  206.                             getDItem(StuffItDialog, stuffCount, iType, stuffHandle, iBox);
  207.                             if GetCtlValue(ControlHandle(stuffHandle)) = 1 then
  208.                                 begin
  209.                                     stuffMode := stuffCount - 2;
  210.                                     leave
  211.                                 end
  212.                         end;
  213.                     DisposDialog(StuffItDialog);
  214.                     DoStuffItDialog := true;
  215.                 end
  216.             else
  217.                 begin        {couldn't find stuffit}
  218.                     StuffItDialog := GetNewDialog(1011, nil, Pointer(-1));
  219.                     SetPort(StuffItDialog);
  220.                     FrameDItem(StuffItDialog, Ok);
  221.                     repeat
  222.                         ModalDialog(nil, StuffItItem);
  223.                     until StuffItItem = OK;
  224.                     DisposDialog(StuffItDialog);
  225.                     DoStuffItDialog := false
  226.                 end;
  227.             SetPort(currentPort)
  228.         end;
  229.  
  230. { ------------------------------------------------------ }
  231.  
  232.     procedure UpdateLogStuff;
  233.  
  234. {    Format for Text Defaults STR 517 is as follows:                }
  235.  
  236. {        1:    Reset CallerLog? (Y/N)                            }
  237. {        2:    Keep CallerLog for Days/Month? (D/M)                }
  238. {        3:    Stuff CallerLog? (N, 1..5)                        }
  239. {        4:    Reset Tabby Log? (Y/N)                            }
  240. {        5:    Keep Tabby Log for Days/Month? (D/M)                }
  241. {        6:    Stuff Tabby Log? (N, 1..5)                        }
  242. {        after these 6 bytes, remainder of string consists of 4        }
  243. {        numeric values with the folowing separators:                }
  244. {        YM3MY3•1•10•1•10                                    }
  245. {              1  2 3  4                                    }
  246. {        1:    CL days                                        }
  247. {        2:    CLA days                                        }
  248. {        3:    TL days                                        }
  249. {        4:    TLA days                                        }
  250.  
  251.         var
  252.             AString: str255;
  253.  
  254.         begin
  255.             AString := 'YD2YD2';
  256.             with tempDefaultPtr^ do
  257.                 begin
  258.                     if not ResetCL then
  259.                         AString[1] := 'N';
  260.                     if not DoCLADays then
  261.                         AString[2] := 'M';
  262.                     if DoCLAStuff = NoStuff then
  263.                         AString[3] := 'N'
  264.                     else
  265.                         AString[3] := stringOf(ord(DoCLAStuff) : 1);
  266.                     if not ResetTL then
  267.                         AString[4] := 'N';
  268.                     if not DoTLADays then
  269.                         AString[5] := 'M';
  270.                     if DoTLAStuff = NoStuff then
  271.                         AString[6] := 'N'
  272.                     else
  273.                         AString[6] := stringOf(ord(DoTLAStuff) : 1);
  274.  
  275.                     AString := concat(AString, BULLET, StringOf(CLDays : 1));
  276.                     AString := concat(AString, BULLET, StringOf(CLADays : 1));
  277.                     AString := concat(AString, BULLET, StringOf(TLDays : 1));
  278.                     AString := concat(AString, BULLET, StringOf(TLADays : 1));
  279.  
  280.                     RmveResource(GetResource('STR ', 517));
  281.                     UpdateResFile(externalResFile);
  282.                     AddResource(Handle(NewString(AString)), 'STR ', 517, 'text defaults')
  283.  
  284.                 end;    {    with tempDefaultPtr^ do    }
  285.  
  286.             RmveResource(GetResource('STR ', 510));
  287.             UpdateResFile(externalResFile);
  288.             AddResource(Handle(NewString(BigLogName)), 'STR ', 510, 'big log name');
  289.  
  290.             RmveResource(GetResource('STR ', 511));
  291.             UpdateResFile(externalResFile);
  292.             AddResource(Handle(NewString(BriefLogName)), 'STR ', 511, 'brief log name');
  293.  
  294.             RmveResource(GetResource('STR ', 512));
  295.             UpdateResFile(externalResFile);
  296.             AddResource(Handle(NewString(MsgErrLogName)), 'STR ', 512, 'msg error log name');
  297.  
  298.             RmveResource(GetResource('STR ', 513));
  299.             UpdateResFile(externalResFile);
  300.             AddResource(Handle(NewString(OrphanLogName)), 'STR ', 513, 'orphan log name');
  301.  
  302.             RmveResource(GetResource('STR ', 514));
  303.             UpdateResFile(externalResFile);
  304.             AddResource(Handle(NewString(Separator)), 'STR ', 514, 'separator')
  305.  
  306.         end;
  307.  
  308. { ------------------------------------------------------ }
  309.  
  310.     procedure UpdateUserStuff;
  311.  
  312.         var
  313.             AString: str255;
  314.  
  315. {    Format for User Defaults STR 516 is as follows:                }
  316.  
  317. {        1:    Process UserLog? (Y/N)                            }
  318. {        2:    Delete level? (Y/N)                                }
  319. {        3:    Sort UserLog? (Y/N)                                }
  320. {        4:    Skip deletes? (Y/N)                                }
  321. {        5:    Zero user minutes? (Y/N)                            }
  322. {        6:    Change level? (Y/N)                                }
  323. {        7:    Kill inactive? (Y/N)                            }
  324. {        8:    Log deletes? (Y/N)                                }
  325. {        9:    One-call limit? (Y/N)                            }
  326. {        10:    Use veteran flag? (Y/N)                            }
  327. {        11:    Set (or clear)? (Y/N)                            }
  328. {        after these 11 bytes, remainder of string consists of 9    }
  329. {        numeric values with the folowing separators:                }
  330. {        YYYYYYYYYYY•0•0•0•0•0•0•0•0•0                            }
  331. {                  1 2 3 4 5 6 7 8 9                            }
  332. {        1:    Delete level                                    }
  333. {        2:    Check level                                    }
  334. {        3:    Change level                                    }
  335. {        4:    Change to level                                }
  336. {        5:    Change to minutes                                }
  337. {        6:    Inactive days                                    }
  338. {        7:    One-call days                                    }
  339. {        8;    Veteran calls                                    }
  340. {        9:    Flag to set/clear                                }
  341.  
  342.         begin
  343.             AString := 'YYYYYYYYYYY';
  344.  
  345.             with tempDefaultPtr^ do
  346.                 begin
  347.                     if ProcessUL = false then
  348.                         AString[1] := 'N';
  349.                     if DeleteByLevel = false then
  350.                         AString[2] := 'N';
  351.                     if SortUserLog = false then
  352.                         AString[3] := 'N';
  353.                     if SkipDeletes = false then
  354.                         AString[4] := 'N';
  355.                     if ZeroMin = false then
  356.                         AString[5] := 'N';
  357.                     if DoChangeLevel = false then
  358.                         AString[6] := 'N';
  359.                     if KillOld = false then
  360.                         AString[7] := 'N';
  361.                     if LogDeletes = false then
  362.                         AString[8] := 'N';
  363.                     if KillOldOneCalls = false then
  364.                         AString[9] := 'N';
  365.                     if UseVetFlag = false then
  366.                         AString[10] := 'N';
  367.                     if SetVetFlag = false then
  368.                         AString[11] := 'N';
  369.                     AString := concat(AString, BULLET, StringOf(DeleteLevel : 1));
  370.                     AString := concat(AString, BULLET, StringOf(CheckLevel : 1));
  371.                     AString := concat(AString, BULLET, StringOf(ChangeLevel : 1));
  372.                     AString := concat(AString, BULLET, StringOf(ChangeToLevel : 1));
  373.                     AString := concat(AString, BULLET, StringOf(ChangeToMin : 1));
  374.                     AString := concat(AString, BULLET, StringOf(InactiveDays : 1));
  375.                     AString := concat(AString, BULLET, StringOf(OneCallDays : 1));
  376.                     AString := concat(AString, BULLET, StringOf(VetCalls : 1));
  377.                     AString := concat(AString, BULLET, StringOf(VetFlag : 1));
  378.  
  379.                     RmveResource(GetResource('STR ', 516));
  380.                     UpdateResFile(externalResFile);
  381.                     AddResource(Handle(NewString(AString)), 'STR ', 516, 'user defaults');
  382.  
  383.                     RmveResource(GetResource('STR ', 515));
  384.                     UpdateResFile(externalResFile);
  385.                     AddResource(Handle(NewString(TextType)), 'STR ', 515, 'text type');
  386.  
  387.                 end;    {    with tempDefaultPtr^ do    }
  388.         end;
  389.  
  390. {-----------------------------------------------------------------    }
  391.  
  392.     procedure ConfigTextArchives;
  393.  
  394.         const
  395.             CancelButton = 2;
  396.             HelpButton = 4;
  397.             ResetCLButton = 5;
  398.             CLDaysField = 6;
  399.             KeepCLAButton = 7;
  400.             MonthlyCLAButton = 8;
  401.             CLADaysField = 9;
  402.             StuffCLAButton = 10;
  403.             ResetTLButton = 11;
  404.             TLDaysField = 12;
  405.             KeepTLAButton = 13;
  406.             MonthlyTLAButton = 14;
  407.             TLADaysField = 15;
  408.             StuffTLAButton = 16;
  409.             CTxtDlog = 1013;
  410.  
  411.         var
  412.             CTxtDialog: DialogPtr;
  413.             CTxtItem, stuffTemp: integer;
  414.             aBox: rect;
  415.             tempString: str255;
  416.  
  417.         begin
  418. {    Format for Text Defaults STR 517 is as follows:                }
  419.  
  420. {        1:    Reset CallerLog? (Y/N)                            }
  421. {        2:    Keep CallerLog for Days/Month? (D/M)                }
  422. {        3:    Stuff CallerLog? (N, 1..5)                        }
  423. {        4:    Reset Tabby Log? (Y/N)                            }
  424. {        5:    Keep Tabby Log for Days/Month? (D/M)                }
  425. {        6:    Stuff Tabby Log? (N, 1..5)                        }
  426. {        after these 6 bytes, remainder of string consists of 4        }
  427. {        numeric values with the folowing separators:                }
  428. {        YY3YY3•1•10•1•10                                    }
  429. {              1  2 3  4                                    }
  430. {        1:    CL days                                        }
  431. {        2:    CLA days                                        }
  432. {        3:    TL days                                        }
  433. {        4:    TLA days                                        }
  434.  
  435.             CTxtDialog := GetNewDialog(CTxtDlog, nil, Pointer(-1));
  436.             SetPort(CTxtDialog);
  437.             FrameDItem(CTxtDialog, Ok);
  438.  
  439.             with tempDefaultPtr^ do
  440.                 begin
  441.                     getDItem(CTxtDialog, CLDaysField, iType, iHandle, aBox);
  442.                     SetIText(iHandle, StringOf(CLDays : 1));
  443.  
  444.                     getDItem(CTxtDialog, CLADaysField, iType, iHandle, aBox);
  445.                     SetIText(iHandle, StringOf(CLADays : 1));
  446.  
  447.                     getDItem(CTxtDialog, TLDaysField, iType, iHandle, aBox);
  448.                     SetIText(iHandle, StringOf(TLDays : 1));
  449.  
  450.                     getDItem(CTxtDialog, TLADaysField, iType, iHandle, aBox);
  451.                     SetIText(iHandle, StringOf(TLADays : 1));
  452.  
  453.                     getDItem(CTxtDialog, ResetCLButton, iType, iHandle, aBox);
  454.                     if ResetCL then
  455.                         SetCtlValue(ControlHandle(iHandle), 1)
  456.                     else
  457.                         SetCtlValue(ControlHandle(iHandle), 0);
  458.  
  459.                     getDItem(CTxtDialog, KeepCLAButton, iType, iHandle, aBox);
  460.                     if DoCLADays then
  461.                         begin
  462.                             SetCtlValue(ControlHandle(iHandle), 1);
  463.                             getDItem(CTxtDialog, MonthlyCLAButton, iType, iHandle, aBox);
  464.                             SetCtlValue(ControlHandle(iHandle), 0);
  465.                         end
  466.                     else
  467.                         begin
  468.                             SetCtlValue(ControlHandle(iHandle), 0);
  469.                             getDItem(CTxtDialog, MonthlyCLAButton, iType, iHandle, aBox);
  470.                             SetCtlValue(ControlHandle(iHandle), 1);
  471.                         end;
  472.  
  473.                     getDItem(CTxtDialog, ResetTLButton, iType, iHandle, aBox);
  474.                     if ResetTL then
  475.                         SetCtlValue(ControlHandle(iHandle), 1)
  476.                     else
  477.                         SetCtlValue(ControlHandle(iHandle), 0);
  478.  
  479.                     getDItem(CTxtDialog, KeepTLAButton, iType, iHandle, aBox);
  480.                     if DoTLADays then
  481.                         begin
  482.                             SetCtlValue(ControlHandle(iHandle), 1);
  483.                             getDItem(CTxtDialog, MonthlyTLAButton, iType, iHandle, aBox);
  484.                             SetCtlValue(ControlHandle(iHandle), 0);
  485.                         end
  486.                     else
  487.                         begin
  488.                             SetCtlValue(ControlHandle(iHandle), 0);
  489.                             getDItem(CTxtDialog, MonthlyTLAButton, iType, iHandle, aBox);
  490.                             SetCtlValue(ControlHandle(iHandle), 1);
  491.                         end;
  492.  
  493.                     getDItem(CTxtDialog, StuffCLAButton, iType, iHandle, aBox);
  494.                     if DoCLAStuff <> NoStuff then
  495.                         SetCtlValue(ControlHandle(iHandle), 1)
  496.                     else
  497.                         SetCtlValue(ControlHandle(iHandle), 0);
  498.  
  499.                     getDItem(CTxtDialog, StuffTLAButton, iType, iHandle, aBox);
  500.                     if DoTLAStuff <> NoStuff then
  501.                         SetCtlValue(ControlHandle(iHandle), 1)
  502.                     else
  503.                         SetCtlValue(ControlHandle(iHandle), 0);
  504.  
  505.                     repeat
  506.                         ModalDialog(nil, CTxtItem);
  507.                         case CTxtItem of
  508.                             Ok: 
  509.                                 begin
  510.                                     Finished := true;
  511.                                     CLDays := GetTheNumber(CTxtDialog, CLDaysField);
  512.                                     CLADays := GetTheNumber(CTxtDialog, CLADaysField);
  513.                                     TLDays := GetTheNumber(CTxtDialog, TLDaysField);
  514.                                     TLADays := GetTheNumber(CTxtDialog, TLADaysField);
  515.                                 end;
  516.  
  517.                             CancelButton: 
  518.                                 Cancel := true;
  519.  
  520.                             HelpButton: 
  521.                                 begin
  522.                                     GetHelp(258);
  523.                                     SetPort(CTxtDialog);
  524.                                     FrameDItem(CTxtDialog, Ok);
  525.                                 end;
  526.  
  527.                             ResetCLButton: 
  528.                                 begin
  529.                                     ResetCL := not ResetCL;
  530.                                     ToggleItem(CTxtDialog, ResetCLButton)
  531.                                 end;
  532.  
  533.                             KeepCLAButton: 
  534.                                 begin
  535.                                     getDItem(CTxtDialog, KeepCLAButton, iType, iHandle, iBox);
  536.                                     if GetCtlValue(ControlHandle(iHandle)) = 0 then
  537.                                         begin
  538.                                             SetCtlValue(ControlHandle(iHandle), 1);
  539.                                             getDItem(CTxtDialog, MonthlyCLAButton, iType, iHandle, iBox);
  540.                                             SetCtlValue(ControlHandle(iHandle), 0);
  541.                                             DoCLADays := true
  542.                                         end
  543.                                     else
  544.                                         DoCLADays := false
  545.                                 end;
  546.  
  547.                             MonthlyCLAButton: 
  548.                                 begin
  549.                                     getDItem(CTxtDialog, MonthlyCLAButton, iType, iHandle, iBox);
  550.                                     if GetCtlValue(ControlHandle(iHandle)) = 0 then
  551.                                         begin
  552.                                             SetCtlValue(ControlHandle(iHandle), 1);
  553.                                             getDItem(CTxtDialog, KeepCLAButton, iType, iHandle, iBox);
  554.                                             SetCtlValue(ControlHandle(iHandle), 0);
  555.                                             DoCLADays := false;
  556.                                         end
  557.                                     else
  558.                                         DoCLADays := true
  559.                                 end;
  560.  
  561.                             StuffCLAButton: 
  562.                                 begin
  563.                                     ToggleItem(CTxtDialog, StuffCLAButton);
  564.                                     getDItem(CTxtDialog, StuffCLAButton, iType, iHandle, iBox);
  565.                                     if GetCtlValue(ControlHandle(iHandle)) <> 0 then
  566.                                         begin
  567.                                             stuffTemp := ord(DoCLAStuff);
  568.                                             if DoStuffItDialog(stuffTemp) then
  569.                                                 DoCLAStuff := StuffOpts(stuffTemp)
  570.                                         end
  571.                                     else
  572.                                         begin
  573.                                             SetCtlValue(ControlHandle(iHandle), 0);
  574.                                             DoCLAStuff := NoStuff
  575.                                         end;
  576.                                     FrameDItem(CTxtDialog, Ok)
  577.                                 end;
  578.  
  579.                             StuffTLAButton: 
  580.                                 begin
  581.                                     ToggleItem(CTxtDialog, StuffTLAButton);
  582.                                     getDItem(CTxtDialog, StuffTLAButton, iType, iHandle, iBox);
  583.                                     if GetCtlValue(ControlHandle(iHandle)) <> 0 then
  584.                                         begin
  585.                                             stuffTemp := ord(DoTLAStuff);
  586.                                             if DoStuffItDialog(stuffTemp) then
  587.                                                 DoTLAStuff := StuffOpts(stuffTemp)
  588.                                         end
  589.                                     else
  590.                                         begin
  591.                                             SetCtlValue(ControlHandle(iHandle), 0);
  592.                                             DoTLAStuff := NoStuff
  593.                                         end;
  594.                                     FrameDItem(CTxtDialog, Ok)
  595.                                 end;
  596.  
  597.                             ResetTLButton: 
  598.                                 begin
  599.                                     ResetTL := not ResetTL;
  600.                                     ToggleItem(CTxtDialog, ResetTLButton)
  601.                                 end;
  602.  
  603.                             KeepTLAButton: 
  604.                                 begin
  605.                                     getDItem(CTxtDialog, KeepTLAButton, iType, iHandle, iBox);
  606.                                     if GetCtlValue(ControlHandle(iHandle)) = 0 then
  607.                                         begin
  608.                                             SetCtlValue(ControlHandle(iHandle), 1);
  609.                                             getDItem(CTxtDialog, MonthlyTLAButton, iType, iHandle, iBox);
  610.                                             SetCtlValue(ControlHandle(iHandle), 0);
  611.                                             DoTLADays := true
  612.                                         end
  613.                                     else
  614.                                         DoTLADays := false
  615.                                 end;
  616.  
  617.                             MonthlyTLAButton: 
  618.                                 begin
  619.                                     getDItem(CTxtDialog, MonthlyTLAButton, iType, iHandle, iBox);
  620.                                     if GetCtlValue(ControlHandle(iHandle)) = 0 then
  621.                                         begin
  622.                                             SetCtlValue(ControlHandle(iHandle), 1);
  623.                                             getDItem(CTxtDialog, KeepTLAButton, iType, iHandle, iBox);
  624.                                             SetCtlValue(ControlHandle(iHandle), 0);
  625.                                             DoTLADays := false;
  626.                                         end
  627.                                     else
  628.                                         DoTLADays := true;
  629.                                 end;
  630.  
  631.                         end;    {case}
  632.  
  633.                     until CTxtItem in [Ok, CancelButton];
  634.  
  635.                 end;    {with tempDefaultPtr^ do}
  636.  
  637.             DisposDialog(CTxtDialog);
  638.         end;
  639.  
  640. {-----------------------------------------------------------------    }
  641.  
  642.     procedure ConfigUserLogDialog;
  643.  
  644.         const
  645.             CancelButton = 2;
  646.             MoreButton = 3;
  647.             HelpButton = 4;
  648.  
  649.         var
  650.             ULDialog: DialogPtr;
  651.             ULItem: integer;
  652.             aBox: rect;
  653.             tempString: str255;
  654.  
  655. {-----------------------------------------------------------------    }
  656.  
  657.         begin
  658.             ULDialog := GetNewDialog(1012, nil, Pointer(-1));
  659.             SetPort(ULDialog);
  660.             FrameDItem(ULDialog, Ok);
  661.  
  662.             with tempDefaultPtr^ do
  663.                 begin
  664.                     getDItem(ULDialog, 6, iType, iHandle, aBox);
  665.                     SetIText(iHandle, TextType);
  666.  
  667.                     tempString := stringOf(DeleteLevel : 1);
  668.                     getDItem(ULDialog, 8, iType, iHandle, aBox);
  669.                     SetIText(iHandle, tempString);
  670.  
  671.                     tempString := stringOf(CheckLevel : 1);
  672.                     getDItem(ULDialog, 9, iType, iHandle, aBox);
  673.                     SetIText(iHandle, tempString);
  674.  
  675.                     tempString := stringOf(ChangeLevel : 1);
  676.                     getDItem(ULDialog, 14, iType, iHandle, aBox);
  677.                     SetIText(iHandle, tempString);
  678.  
  679.                     tempString := stringOf(ChangeToLevel : 1);
  680.                     getDItem(ULDialog, 15, iType, iHandle, aBox);
  681.                     SetIText(iHandle, tempString);
  682.  
  683.                     tempString := stringOf(ChangeToMin : 1);
  684.                     getDItem(ULDialog, 16, iType, iHandle, aBox);
  685.                     SetIText(iHandle, tempString);
  686.  
  687.                     tempString := stringOf(ChangeToMin : 1);
  688.                     getDItem(ULDialog, 16, iType, iHandle, aBox);
  689.                     SetIText(iHandle, tempString);
  690.  
  691.                     tempString := stringOf(InactiveDays : 1);
  692.                     getDItem(ULDialog, 18, iType, iHandle, aBox);
  693.                     SetIText(iHandle, tempString);
  694.  
  695.                     tempString := stringOf(OneCallDays : 1);
  696.                     getDItem(ULDialog, 21, iType, iHandle, aBox);
  697.                     SetIText(iHandle, tempString);
  698.  
  699.                     tempString := stringOf(VetCalls : 1);
  700.                     getDItem(ULDialog, 23, iType, iHandle, aBox);
  701.                     SetIText(iHandle, tempString);
  702.  
  703.                     tempString := stringOf(VetFlag : 1);
  704.                     getDItem(ULDialog, 26, iType, iHandle, aBox);
  705.                     SetIText(iHandle, tempString);
  706.  
  707.                     getDItem(ULDialog, 5, iType, iHandle, iBox);
  708.                     if ProcessUL then
  709.                         SetCtlValue(ControlHandle(iHandle), 1)
  710.                     else
  711.                         SetCtlValue(ControlHandle(iHandle), 0);
  712.  
  713.                     getDItem(ULDialog, 7, iType, iHandle, iBox);
  714.                     if DeleteByLevel then
  715.                         SetCtlValue(ControlHandle(iHandle), 1)
  716.                     else
  717.                         SetCtlValue(ControlHandle(iHandle), 0);
  718.  
  719.                     getDItem(ULDialog, 10, iType, iHandle, iBox);
  720.                     if SortUserLog then
  721.                         SetCtlValue(ControlHandle(iHandle), 1)
  722.                     else
  723.                         SetCtlValue(ControlHandle(iHandle), 0);
  724.  
  725.                     getDItem(ULDialog, 11, iType, iHandle, iBox);
  726.                     if SkipDeletes then
  727.                         SetCtlValue(ControlHandle(iHandle), 1)
  728.                     else
  729.                         SetCtlValue(ControlHandle(iHandle), 0);
  730.  
  731.                     getDItem(ULDialog, 12, iType, iHandle, iBox);
  732.                     if ZeroMin then
  733.                         SetCtlValue(ControlHandle(iHandle), 1)
  734.                     else
  735.                         SetCtlValue(ControlHandle(iHandle), 0);
  736.  
  737.                     getDItem(ULDialog, 13, iType, iHandle, iBox);
  738.                     if DoChangeLevel then
  739.                         SetCtlValue(ControlHandle(iHandle), 1)
  740.                     else
  741.                         SetCtlValue(ControlHandle(iHandle), 0);
  742.  
  743.                     getDItem(ULDialog, 17, iType, iHandle, iBox);
  744.                     if KillOld then
  745.                         SetCtlValue(ControlHandle(iHandle), 1)
  746.                     else
  747.                         SetCtlValue(ControlHandle(iHandle), 0);
  748.  
  749.                     getDItem(ULDialog, 19, iType, iHandle, iBox);
  750.                     if LogDeletes then
  751.                         SetCtlValue(ControlHandle(iHandle), 1)
  752.                     else
  753.                         SetCtlValue(ControlHandle(iHandle), 0);
  754.  
  755.                     getDItem(ULDialog, 20, iType, iHandle, iBox);
  756.                     if KillOldOneCalls then
  757.                         SetCtlValue(ControlHandle(iHandle), 1)
  758.                     else
  759.                         SetCtlValue(ControlHandle(iHandle), 0);
  760.  
  761.                     getDItem(ULDialog, 22, iType, iHandle, iBox);
  762.                     if UseVetFlag then
  763.                         SetCtlValue(ControlHandle(iHandle), 1)
  764.                     else
  765.                         SetCtlValue(ControlHandle(iHandle), 0);
  766.  
  767.                     getDItem(ULDialog, 24, iType, iHandle, iBox);
  768.                     if SetVetFlag then
  769.                         begin
  770.                             SetCtlValue(ControlHandle(iHandle), 1);
  771.                             getDItem(ULDialog, 25, iType, iHandle, iBox);
  772.                             SetCtlValue(ControlHandle(iHandle), 0);
  773.                         end
  774.                     else
  775.                         begin
  776.                             SetCtlValue(ControlHandle(iHandle), 0);
  777.                             getDItem(ULDialog, 25, iType, iHandle, iBox);
  778.                             SetCtlValue(ControlHandle(iHandle), 1);
  779.                         end;
  780.  
  781.                     repeat
  782.                         ModalDialog(nil, ULItem);
  783.                         case ULItem of
  784.                             Ok, MoreButton: 
  785.                                 begin
  786.                                     getDItem(ULDialog, 5, iType, iHandle, iBox);
  787.                                     if GetCtlValue(ControlHandle(iHandle)) = 0 then
  788.                                         ProcessUL := false
  789.                                     else
  790.                                         ProcessUL := true;
  791.                                     getDItem(ULDialog, 7, iType, iHandle, iBox);
  792.                                     if GetCtlValue(ControlHandle(iHandle)) = 0 then
  793.                                         DeleteByLevel := false
  794.                                     else
  795.                                         DeleteByLevel := true;
  796.                                     getDItem(ULDialog, 10, iType, iHandle, iBox);
  797.                                     if GetCtlValue(ControlHandle(iHandle)) = 0 then
  798.                                         SortUserLog := false
  799.                                     else
  800.                                         SortUserLog := true;
  801.                                     getDItem(ULDialog, 11, iType, iHandle, iBox);
  802.                                     if GetCtlValue(ControlHandle(iHandle)) = 0 then
  803.                                         SkipDeletes := false
  804.                                     else
  805.                                         SkipDeletes := true;
  806.                                     getDItem(ULDialog, 12, iType, iHandle, iBox);
  807.                                     if GetCtlValue(ControlHandle(iHandle)) = 0 then
  808.                                         ZeroMin := false
  809.                                     else
  810.                                         ZeroMin := true;
  811.                                     getDItem(ULDialog, 13, iType, iHandle, iBox);
  812.                                     if GetCtlValue(ControlHandle(iHandle)) = 0 then
  813.                                         DoChangeLevel := false
  814.                                     else
  815.                                         DoChangeLevel := true;
  816.                                     getDItem(ULDialog, 17, iType, iHandle, iBox);
  817.                                     if GetCtlValue(ControlHandle(iHandle)) = 0 then
  818.                                         KillOld := false
  819.                                     else
  820.                                         KillOld := true;
  821.                                     getDItem(ULDialog, 19, iType, iHandle, iBox);
  822.                                     if GetCtlValue(ControlHandle(iHandle)) = 0 then
  823.                                         LogDeletes := false
  824.                                     else
  825.                                         LogDeletes := true;
  826.                                     getDItem(ULDialog, 20, iType, iHandle, iBox);
  827.                                     if GetCtlValue(ControlHandle(iHandle)) = 0 then
  828.                                         KillOldOneCalls := false
  829.                                     else
  830.                                         KillOldOneCalls := true;
  831.                                     getDItem(ULDialog, 22, iType, iHandle, iBox);
  832.                                     if GetCtlValue(ControlHandle(iHandle)) = 0 then
  833.                                         UseVetFlag := false
  834.                                     else
  835.                                         UseVetFlag := true;
  836.                                     getDItem(ULDialog, 24, iType, iHandle, iBox);
  837.                                     if GetCtlValue(ControlHandle(iHandle)) = 0 then
  838.                                         SetVetFlag := false
  839.                                     else
  840.                                         SetVetFlag := true;
  841.                                     GetDItem(ULDialog, 6, iType, iHandle, iBox);
  842.                                     GetIText(iHandle, tempString);
  843.                                     TextType := tempString;
  844.                                     DeleteLevel := GetTheNumber(ULDialog, 8);
  845.                                     CheckLevel := GetTheNumber(ULDialog, 9);
  846.                                     ChangeLevel := GetTheNumber(ULDialog, 14);
  847.                                     ChangeToLevel := GetTheNumber(ULDialog, 15);
  848.                                     ChangeToMin := GetTheNumber(ULDialog, 16);
  849.                                     InactiveDays := GetTheNumber(ULDialog, 18);
  850.                                     OneCallDays := GetTheNumber(ULDialog, 21);
  851.                                     VetCalls := GetTheNumber(ULDialog, 23);
  852.                                     VetFlag := GetTheNumber(ULDialog, 26);
  853.                                     if (ULItem = Ok) then
  854.                                         Finished := true;
  855.                                 end;
  856.  
  857.                             CancelButton: 
  858.                                 Cancel := true;
  859.  
  860.                             HelpButton: 
  861.                                 begin
  862.                                     GetHelp(258);
  863.                                     SetPort(ULDialog);
  864.                                     FrameDItem(ULDialog, Ok);
  865.                                 end;
  866.  
  867.                             5, 7, 10..13, 17, 19, 20, 22: 
  868.                                 begin
  869.                                     getDItem(ULDialog, ULItem, iType, iHandle, iBox);
  870.                                     ToggleItem(ULDialog, ULItem);
  871.                                 end;
  872.  
  873.                             24: 
  874.                                 begin
  875.                                     getDItem(ULDialog, 24, iType, iHandle, iBox);
  876.                                     if GetCtlValue(ControlHandle(iHandle)) = 0 then
  877.                                         begin
  878.                                             SetCtlValue(ControlHandle(iHandle), 1);
  879.                                             getDItem(ULDialog, 25, iType, iHandle, iBox);
  880.                                             SetCtlValue(ControlHandle(iHandle), 0)
  881.                                         end
  882.                                 end;
  883.  
  884.                             25: 
  885.                                 begin
  886.                                     getDItem(ULDialog, 25, iType, iHandle, iBox);
  887.                                     if GetCtlValue(ControlHandle(iHandle)) = 0 then
  888.                                         begin
  889.                                             SetCtlValue(ControlHandle(iHandle), 1);
  890.                                             getDItem(ULDialog, 24, iType, iHandle, iBox);
  891.                                             SetCtlValue(ControlHandle(iHandle), 0)
  892.                                         end
  893.                                 end;
  894.  
  895.                             otherwise
  896.                                 ;
  897.  
  898.                         end;
  899.  
  900.                     until ULItem in [Ok..MoreButton];
  901.  
  902.                     DisposDialog(ULDialog);
  903.                 end;{with tempDefaultPtr^ do}
  904.             if ULItem = MoreButton then
  905.                 ConfigTextArchives
  906.         end;
  907.  
  908. {-----------------------------------------------------------------    }
  909.  
  910.         var
  911.             whatToFind: SFTypeList;
  912.             fileReply: SFReply;
  913.             stuffTemp, newItem, stringCount: integer;
  914.             newDefaultsDialog: DialogPtr;
  915.             tempString: str255;
  916.             rezHandle: handle;
  917.  
  918.     begin
  919.         tempDefaultPtr := DefaultStuffPtr(NewPtr(sizeOf(DefaultStuff)));
  920.  
  921.         ConfigDialog := GetNewDialog(1007, nil, Pointer(-1));
  922.         SetPort(ConfigDialog);
  923.         FrameDItem(ConfigDialog, Ok);
  924.  
  925.         tempDefaultPtr^ := DefaultsPtr^;
  926.  
  927.         with tempDefaultPtr^ do
  928.             begin
  929.                 getDItem(ConfigDialog, 4, iType, iHandle, EField1);
  930.                 SetIText(iHandle, DNextLaunch);
  931.  
  932.                 getDItem(ConfigDialog, 6, iType, iHandle, EField2);
  933.                 SetIText(iHandle, DBackupPath);
  934.  
  935.                 getDItem(ConfigDialog, 8, iType, iHandle, EField3);
  936.                 SetIText(iHandle, DTextPath);
  937.  
  938.                 getDItem(ConfigDialog, 22, iType, iHandle, EField4);
  939.                 SetIText(iHandle, BUTextPath);
  940.  
  941.                 getDItem(ConfigDialog, 24, iType, iHandle, EField5);
  942.                 SetIText(iHandle, MaxBUSize);
  943.  
  944. {    Format for Defaults string is 'XXXXX', where positions are as follows:    }
  945.  
  946. {        1:    Write to Tabby Log? (Y/N)                        }
  947. {        2:    Full mehit Log? (Y/N)                            }
  948. {        3:    Brief mehit Log? (Y/N)                            }
  949. {        4:    Backup: Normal, Kill after, Purge, Stuff (B/K/P/0..5)    }
  950. {        5:    Error Message Log? (Y/N)                            }
  951. {        6:    Undelete deleted pub messages? (Y/N)                }
  952.  
  953.                 for Counter := 1 to 3 do
  954.                     begin
  955.                         getDItem(ConfigDialog, Counter + 8, iType, iHandle, iBox);
  956.                         if Defaults[Counter] = 'Y' then
  957.                             SetCtlValue(ControlHandle(iHandle), 1)
  958.                         else
  959.                             SetCtlValue(ControlHandle(iHandle), 0)
  960.                     end;
  961.  
  962.                 for Counter := 12 to 14 do
  963.                     begin
  964.                         getDItem(ConfigDialog, Counter, iType, iHandle, iBox);
  965.                         SetCtlValue(ControlHandle(iHandle), 0);
  966.                     end;
  967.  
  968.                 getDItem(ConfigDialog, 29, iType, iHandle, iBox);
  969.                 SetCtlValue(ControlHandle(iHandle), 0);
  970.  
  971.                 case DBackupMode of
  972.                     Normal: 
  973.                         begin
  974.                             getDItem(ConfigDialog, 12, iType, iHandle, iBox);
  975.                             SetCtlValue(ControlHandle(iHandle), 1)
  976.                         end;
  977.  
  978.                     Kill: 
  979.                         begin
  980.                             getDItem(ConfigDialog, 13, iType, iHandle, iBox);
  981.                             SetCtlValue(ControlHandle(iHandle), 1)
  982.                         end;
  983.  
  984.                     Purge: 
  985.                         begin
  986.                             getDItem(ConfigDialog, 14, iType, iHandle, iBox);
  987.                             SetCtlValue(ControlHandle(iHandle), 1)
  988.                         end;
  989.  
  990.                     StuffNone..StuffBetter: 
  991.                         begin
  992.                             getDItem(ConfigDialog, 29, iType, iHandle, iBox);
  993.                             SetCtlValue(ControlHandle(iHandle), 1)
  994.                         end;
  995.  
  996.                     otherwise
  997.                         begin
  998.                         end;    {what???}
  999.  
  1000.                 end;    {    Case Defaults    }
  1001.  
  1002.                 getDItem(ConfigDialog, 27, iType, iHandle, iBox);
  1003.                 if LogErrors then
  1004.                     SetCtlValue(ControlHandle(iHandle), 1)
  1005.                 else
  1006.                     SetCtlValue(ControlHandle(iHandle), 0);
  1007.  
  1008.                 getDItem(ConfigDialog, 28, iType, iHandle, iBox);
  1009.                 if Undelete then
  1010.                     SetCtlValue(ControlHandle(iHandle), 1)
  1011.                 else
  1012.                     SetCtlValue(ControlHandle(iHandle), 0);
  1013.  
  1014.                 getDItem(ConfigDialog, 31, iType, iHandle, iBox);
  1015.                 if Renumber then
  1016.                     SetCtlValue(ControlHandle(iHandle), 1)
  1017.                 else
  1018.                     SetCtlValue(ControlHandle(iHandle), 0);
  1019.  
  1020.             end;    {    with tempDefaultPtr^ do    }
  1021.  
  1022.         DrawDialog(ConfigDialog);
  1023.         Finished := false;
  1024.         Cancel := false;
  1025.         repeat
  1026.             ModalDialog(nil, DItem);
  1027.             case DItem of
  1028.  
  1029.                 1:                 {    OK                        }
  1030.                     Finished := true;
  1031.  
  1032.                 2:                 {    Cancel                    }
  1033.                     Cancel := true;
  1034.  
  1035.                 3:                 {    Select Next Launch            }
  1036.                     if ButtonSelected(ConfigDialog, 3) then
  1037.                         begin
  1038.                             where.h := 60;
  1039.                             where.v := 80;
  1040.                             whatToFind[0] := 'APPL';
  1041.                             ParamText('select next launch', '', '', '');
  1042.                             SFPGetFile(where, '', nil, 1, whatToFind, nil, fileReply, 4000, nil);
  1043.                             if fileReply.good then
  1044.                                 begin
  1045.                                     getDItem(ConfigDialog, 4, iType, iHandle, iBox);
  1046.                                     SetIText(iHandle, fileReply.fName);
  1047.                                 end;
  1048.                             FrameDItem(ConfigDialog, Ok);
  1049.                         end;
  1050.  
  1051.                 5:                 {    Select Backup Path            }
  1052.                     if ButtonSelected(ConfigDialog, 5) then
  1053.                         begin
  1054.                             where.h := 60;
  1055.                             where.v := 80;
  1056.                             SFPPutFile(where, 'select backup location', 'click to select', nil, fileReply, 3999, nil);
  1057.  
  1058.                             if fileReply.good then
  1059.                                 begin
  1060.                                     Err := Create(fileReply.fname, fileReply.vRefNum, 'QED1', 'TEXT');
  1061.                                     MakePath(fileReply.fname, fileReply.vRefNum, PathName);
  1062.                                     Err := FSDelete(fileReply.fname, fileReply.vRefNum);
  1063.                                     getDItem(ConfigDialog, 6, iType, iHandle, iBox);
  1064.                                     SetIText(iHandle, PathName);
  1065.                                 end;
  1066.                             FrameDItem(ConfigDialog, Ok);
  1067.                         end;
  1068.  
  1069.                 7:                     {    Select TextFiles Path    }
  1070.                     if ButtonSelected(ConfigDialog, 7) then
  1071.                         begin
  1072.                             where.h := 60;
  1073.                             where.v := 80;
  1074.                             SFPPutFile(where, 'select text files location', 'click to select', nil, fileReply, 3999, nil);
  1075.  
  1076.                             if fileReply.good then
  1077.                                 begin
  1078.                                     Err := Create(fileReply.fname, fileReply.vRefNum, 'QED1', 'TEXT');
  1079.                                     MakePath(fileReply.fname, fileReply.vRefNum, PathName);
  1080.                                     Err := FSDelete(fileReply.fname, fileReply.vRefNum);
  1081.                                     getDItem(ConfigDialog, 8, iType, iHandle, iBox);
  1082.                                     SetIText(iHandle, PathName);
  1083.                                 end;
  1084.                             FrameDItem(ConfigDialog, Ok);
  1085.                         end;
  1086.  
  1087.                 23:                     {    Select B/U TextFiles Path    }
  1088.                     if ButtonSelected(ConfigDialog, 23) then
  1089.                         begin
  1090.                             where.h := 60;
  1091.                             where.v := 80;
  1092.                             SFPPutFile(where, 'select b/u text files location', 'click to select', nil, fileReply, 3999, nil);
  1093.  
  1094.                             if fileReply.good then
  1095.                                 begin
  1096.                                     Err := Create(fileReply.fname, fileReply.vRefNum, 'QED1', 'TEXT');
  1097.                                     MakePath(fileReply.fname, fileReply.vRefNum, PathName);
  1098.                                     Err := FSDelete(fileReply.fname, fileReply.vRefNum);
  1099.                                     getDItem(ConfigDialog, 22, iType, iHandle, iBox);
  1100.                                     SetIText(iHandle, PathName);
  1101.                                 end;
  1102.                             FrameDItem(ConfigDialog, Ok);
  1103.                         end;
  1104.  
  1105.                 9, 10, 11, 27, 28, 31: 
  1106.                     ToggleItem(ConfigDialog, DItem);
  1107.  
  1108.                 12: 
  1109.                     begin
  1110.                         getDItem(ConfigDialog, 12, iType, iHandle, iBox);
  1111.                         if GetCtlValue(ControlHandle(iHandle)) = 0 then
  1112.                             begin
  1113.                                 SetCtlValue(ControlHandle(iHandle), 1);
  1114.                                 getDItem(ConfigDialog, 13, iType, iHandle, iBox);
  1115.                                 SetCtlValue(ControlHandle(iHandle), 0);
  1116.                                 getDItem(ConfigDialog, 14, iType, iHandle, iBox);
  1117.                                 SetCtlValue(ControlHandle(iHandle), 0);
  1118.                                 getDItem(ConfigDialog, 29, iType, iHandle, iBox);
  1119.                                 SetCtlValue(ControlHandle(iHandle), 0);
  1120.                             end;
  1121.                     end;
  1122.  
  1123.                 13: 
  1124.                     begin
  1125.                         getDItem(ConfigDialog, 13, iType, iHandle, iBox);
  1126.                         if GetCtlValue(ControlHandle(iHandle)) = 0 then
  1127.                             begin
  1128.                                 SetCtlValue(ControlHandle(iHandle), 1);
  1129.                                 getDItem(ConfigDialog, 12, iType, iHandle, iBox);
  1130.                                 SetCtlValue(ControlHandle(iHandle), 0);
  1131.                                 getDItem(ConfigDialog, 14, iType, iHandle, iBox);
  1132.                                 SetCtlValue(ControlHandle(iHandle), 0);
  1133.                                 getDItem(ConfigDialog, 29, iType, iHandle, iBox);
  1134.                                 SetCtlValue(ControlHandle(iHandle), 0);
  1135.                             end;
  1136.                     end;
  1137.  
  1138.                 14: 
  1139.                     begin
  1140.                         getDItem(ConfigDialog, 14, iType, iHandle, iBox);
  1141.                         if GetCtlValue(ControlHandle(iHandle)) = 0 then
  1142.                             begin
  1143.                                 SetCtlValue(ControlHandle(iHandle), 1);
  1144.                                 getDItem(ConfigDialog, 12, iType, iHandle, iBox);
  1145.                                 SetCtlValue(ControlHandle(iHandle), 0);
  1146.                                 getDItem(ConfigDialog, 13, iType, iHandle, iBox);
  1147.                                 SetCtlValue(ControlHandle(iHandle), 0);
  1148.                                 getDItem(ConfigDialog, 29, iType, iHandle, iBox);
  1149.                                 SetCtlValue(ControlHandle(iHandle), 0);
  1150.                             end;
  1151.                     end;
  1152.  
  1153.                 29: 
  1154.                     begin
  1155.                         getDItem(ConfigDialog, 29, iType, iHandle, iBox);
  1156.                         stuffTemp := ord(tempDefaultPtr^.DBackupMode) - ord(StuffNone);
  1157.                         if DoStuffItDialog(stuffTemp) then
  1158.                             begin
  1159.                                 tempDefaultPtr^.DBackupMode := BackOpts(stuffTemp + ord(StuffNone));
  1160.                                 FrameDItem(ConfigDialog, Ok);
  1161.                                 SetCtlValue(ControlHandle(iHandle), 1);
  1162.                                 getDItem(ConfigDialog, 12, iType, iHandle, iBox);
  1163.                                 SetCtlValue(ControlHandle(iHandle), 0);
  1164.                                 getDItem(ConfigDialog, 13, iType, iHandle, iBox);
  1165.                                 SetCtlValue(ControlHandle(iHandle), 0);
  1166.                                 getDItem(ConfigDialog, 14, iType, iHandle, iBox);
  1167.                                 SetCtlValue(ControlHandle(iHandle), 0)
  1168.                             end;
  1169.                         FrameDItem(ConfigDialog, Ok);
  1170.                     end;
  1171.  
  1172.                 20:         {    Help Dialog        }
  1173.                     begin
  1174.                         GetHelp(258);
  1175.                         SetPort(ConfigDialog);
  1176.                         FrameDItem(ConfigDialog, Ok);
  1177.                     end;
  1178.  
  1179.                 30:         {    More button        }
  1180.                     begin
  1181.                         ConfigUserLogDialog;
  1182.                         if not (Finished | Cancel) then
  1183.                             begin
  1184.                                 SetPort(ConfigDialog);
  1185.                                 FrameDItem(ConfigDialog, Ok)
  1186.                             end
  1187.                     end;
  1188.  
  1189.                 32:         {    new defaults Dialog        }
  1190.                     begin
  1191.                         newDefaultsDialog := GetNewDialog(1014, nil, Pointer(-1));
  1192.                         SetPort(newDefaultsDialog);
  1193.                         FrameDItem(newDefaultsDialog, Ok);
  1194.                         with tempDefaultPtr^ do
  1195.                             begin
  1196.                                 getDItem(newDefaultsDialog, 2, iType, iHandle, iBox);
  1197.                                 SetIText(iHandle, stringOf(newLimit : 1));
  1198.                                 getDItem(newDefaultsDialog, 3, iType, iHandle, iBox);
  1199.                                 SetIText(iHandle, stringOf(newAge : 1));
  1200.                                 getDItem(newDefaultsDialog, 4, iType, iHandle, iBox);
  1201.                                 if newBU then
  1202.                                     SetCtlValue(ControlHandle(iHandle), 1)
  1203.                                 else
  1204.                                     SetCtlValue(ControlHandle(iHandle), 0);
  1205.                                 repeat
  1206.                                     ModalDialog(nil, newItem);
  1207.                                     case newItem of
  1208.                                         4: 
  1209.                                             begin
  1210.                                                 newBU := not newBU;
  1211.                                                 getDItem(newDefaultsDialog, 4, iType, iHandle, iBox);
  1212.                                                 if newBU then
  1213.                                                     SetCtlValue(ControlHandle(iHandle), 1)
  1214.                                                 else
  1215.                                                     SetCtlValue(ControlHandle(iHandle), 0);
  1216.                                             end;
  1217.                                         otherwise
  1218.                                             ;
  1219.                                     end;{case}
  1220.                                 until newItem = Ok;
  1221.                                 newLimit := GetTheNumber(newDefaultsDialog, 2);
  1222.                                 newAge := GetTheNumber(newDefaultsDialog, 3);
  1223.                             end;{with tempDefaultPtr^}
  1224.                         DisposDialog(newDefaultsDialog);
  1225.                         SetPort(ConfigDialog);
  1226.                         FrameDItem(ConfigDialog, Ok)
  1227.                     end;
  1228.  
  1229.                 otherwise
  1230.                     ;
  1231.             end;
  1232.  
  1233.         until Finished | Cancel;
  1234.  
  1235.         if Finished then
  1236.             with tempDefaultPtr^ do
  1237.                 begin
  1238.                     UseResFile(internalResFile);
  1239.                     GetDItem(ConfigDialog, 4, iType, iHandle, iBox);
  1240.                     GetIText(iHandle, DNextLaunch);
  1241.                     RmveResource(GetResource('STR ', 500));
  1242.                     UpdateResFile(internalResFile);
  1243.                     AddResource(Handle(NewString(DNextLaunch)), 'STR ', 500, 'Next Launch');
  1244.  
  1245.                     UseResFile(externalResFile);
  1246.                     GetDItem(ConfigDialog, 6, iType, iHandle, iBox);
  1247.                     GetIText(iHandle, DBackupPath);
  1248.                     RmveResource(GetResource('STR ', 501));
  1249.                     UpdateResFile(externalResFile);
  1250.                     AddResource(Handle(NewString(DBackupPath)), 'STR ', 501, 'Backup Path:');
  1251.  
  1252.                     GetDItem(ConfigDialog, 8, iType, iHandle, iBox);
  1253.                     GetIText(iHandle, DTextPath);
  1254.                     RmveResource(GetResource('STR ', 502));
  1255.                     UpdateResFile(externalResFile);
  1256.                     AddResource(Handle(NewString(DTextPath)), 'STR ', 502, 'Text Path:');
  1257.  
  1258.                     GetDItem(ConfigDialog, 9, iType, iHandle, iBox);
  1259.                     if GetCtlValue(ControlHandle(iHandle)) = 1 then
  1260.                         begin
  1261.                             WriteToTabby := true;
  1262.                             Defaults[1] := 'Y'
  1263.                         end
  1264.                     else
  1265.                         begin
  1266.                             WriteToTabby := false;
  1267.                             Defaults[1] := 'N'
  1268.                         end;
  1269.  
  1270.                     GetDItem(ConfigDialog, 10, iType, iHandle, iBox);
  1271.                     if GetCtlValue(ControlHandle(iHandle)) = 1 then
  1272.                         begin
  1273.                             FullLog := true;
  1274.                             Defaults[2] := 'Y'
  1275.                         end
  1276.                     else
  1277.                         begin
  1278.                             FullLog := false;
  1279.                             Defaults[2] := 'N'
  1280.                         end;
  1281.  
  1282.                     GetDItem(ConfigDialog, 11, iType, iHandle, iBox);
  1283.                     if GetCtlValue(ControlHandle(iHandle)) = 1 then
  1284.                         begin
  1285.                             BriefLog := true;
  1286.                             Defaults[3] := 'Y'
  1287.                         end
  1288.                     else
  1289.                         begin
  1290.                             BriefLog := false;
  1291.                             Defaults[3] := 'N'
  1292.                         end;
  1293.  
  1294.                     getDItem(ConfigDialog, 12, iType, iHandle, iBox);
  1295.                     if GetCtlValue(ControlHandle(iHandle)) = 1 then
  1296.                         begin
  1297.                             DBackupMode := Normal;
  1298.                             Defaults[4] := 'B';
  1299.                         end
  1300.                     else
  1301.                         begin
  1302.                             getDItem(ConfigDialog, 13, iType, iHandle, iBox);
  1303.                             if GetCtlValue(ControlHandle(iHandle)) = 1 then
  1304.                                 begin
  1305.                                     DBackupMode := Kill;
  1306.                                     Defaults[4] := 'K'
  1307.                                 end
  1308.                             else
  1309.                                 begin
  1310.                                     getDItem(ConfigDialog, 14, iType, iHandle, iBox);
  1311.                                     if GetCtlValue(ControlHandle(iHandle)) = 1 then
  1312.                                         begin
  1313.                                             DBackupMode := Purge;
  1314.                                             Defaults[4] := 'P'
  1315.                                         end
  1316.                                     else
  1317.                                         Defaults[4] := StringOf((ord(DBackupMode) - 2) : 1);
  1318.                                 end
  1319.                         end;
  1320.  
  1321.                     getDItem(ConfigDialog, 27, iType, iHandle, iBox);
  1322.                     if GetCtlValue(ControlHandle(iHandle)) = 1 then
  1323.                         begin
  1324.                             LogErrors := true;
  1325.                             Defaults[5] := 'Y'
  1326.                         end
  1327.                     else
  1328.                         begin
  1329.                             LogErrors := false;
  1330.                             Defaults[5] := 'N'
  1331.                         end;
  1332.  
  1333.                     getDItem(ConfigDialog, 28, iType, iHandle, iBox);
  1334.                     if GetCtlValue(ControlHandle(iHandle)) = 1 then
  1335.                         begin
  1336.                             Undelete := true;
  1337.                             Defaults[6] := 'Y'
  1338.                         end
  1339.                     else
  1340.                         begin
  1341.                             Undelete := false;
  1342.                             Defaults[6] := 'N'
  1343.                         end;
  1344.  
  1345.                     getDItem(ConfigDialog, 31, iType, iHandle, iBox);
  1346.                     if GetCtlValue(ControlHandle(iHandle)) = 1 then
  1347.                         begin
  1348.                             Renumber := true;
  1349.                             Defaults[7] := 'Y'
  1350.                         end
  1351.                     else
  1352.                         begin
  1353.                             Renumber := false;
  1354.                             Defaults[7] := 'N'
  1355.                         end;
  1356.  
  1357.                     RmveResource(GetResource('STR ', 503));
  1358.                     UpdateResFile(externalResFile);
  1359.                     AddResource(Handle(NewString(Defaults)), 'STR ', 503, 'Defaults');
  1360.  
  1361.                     GetDItem(ConfigDialog, 22, iType, iHandle, iBox);
  1362.                     GetIText(iHandle, BUTextPath);
  1363.                     RmveResource(GetResource('STR ', 504));
  1364.                     UpdateResFile(externalResFile);
  1365.                     AddResource(Handle(NewString(BUTextPath)), 'STR ', 504, 'B/U Text Path:');
  1366.  
  1367.                     GetDItem(ConfigDialog, 24, iType, iHandle, iBox);
  1368.                     GetIText(iHandle, MaxBUSize);
  1369.                     RmveResource(GetResource('STR ', 505));
  1370.                     UpdateResFile(externalResFile);
  1371.                     AddResource(Handle(NewString(MaxBUSize)), 'STR ', 505, 'Max B/U Size');
  1372.  
  1373.                     RmveResource(GetResource('STR ', 518));
  1374.                     UpdateResFile(externalResFile);
  1375.                     tempString := concat(stringOf(newLimit : 1), '•', stringOf(newAge : 1), '•');
  1376.                     if newBU then
  1377.                         tempString := concat(tempString, 'Y')
  1378.                     else
  1379.                         tempString := concat(tempString, 'N');
  1380.                     AddResource(Handle(NewString(tempString)), 'STR ', 518, 'new section settings');
  1381.  
  1382.                     UpdateUserStuff;
  1383.                     UpdateLogStuff;
  1384.                     DefaultsPtr^ := tempDefaultPtr^;
  1385.  
  1386.                 end;
  1387.  
  1388.         if tempDefaultPtr <> nil then
  1389.             DisposPtr(POINTER(tempDefaultPtr));
  1390.         if ConfigDialog <> nil then
  1391.             DisposDialog(ConfigDialog);
  1392.     end;
  1393.  
  1394. {-----------------------------------------------------------------    }
  1395.  
  1396. procedure GlobalDialog (var AString: STR255);
  1397.  
  1398.     var
  1399.         GlobalDialog: DialogPtr;
  1400.         DItem, iType: integer;
  1401.         iHandle: Handle;
  1402.         iBox: rect;
  1403.         Finished, Cancel: boolean;
  1404.  
  1405.     begin
  1406.         InitCursor;
  1407.         GlobalDialog := GetNewDialog(1005, nil, Pointer(-1));
  1408.         SetPort(GlobalDialog);
  1409.         FrameDItem(GlobalDialog, Ok);
  1410.         Finished := false;
  1411.         Cancel := false;
  1412.         repeat
  1413.             ModalDialog(nil, DItem);
  1414.             case DItem of
  1415.  
  1416.                 1:                 {    OK                }
  1417.                     begin
  1418.                         Changed := true;
  1419.                         Finished := true;
  1420.                     end;
  1421.                 2:                 {    Cancel            }
  1422.                     Cancel := true;
  1423.                 3: 
  1424.                     ;                   {    Edit field        }
  1425.  
  1426.             end;
  1427.         until Finished | Cancel;
  1428.         if not Cancel then
  1429.             begin
  1430.                 GetDItem(GlobalDialog, 3, iType, iHandle, iBox);
  1431.                 GetIText(iHandle, AString);
  1432.             end
  1433.         else
  1434.             AString := '';
  1435.         DisposDialog(GlobalDialog);
  1436.     end;
  1437. end.